{% extends 'base.html' %}

{% block title %}搜索结果 - {{ query }}{% endblock %}

{% block content %}
    <h1 class="text-center mb-4">搜索结果: {{ query }}</h1>
    {% if words %}
        <h2>单词结果</h2>
        <ul>
            {% for words in wordss %}

                {% for word in words %}
            
                    <li>
                        <a href="{% url 'word_detail' word.id %}">{{ word.word }} - 等级: {{ word.get_level_display }}</a>
                    </li>
                {% endfor %}
            {% endfor %}
        </ul>
    {% endif %}
    {% if terms %}
        <h2>术语结果</h2>
        <ul>
            {% for terms in termss %}
                {% for term in terms %}
                <li>
                    <a href="{% url 'term_detail' term.id %}">{{ term.term_name }}</a>
                </li>
                {% endfor %}
            {% endfor %}
        </ul>
    {% endif %}
    {% if not words and not terms %}
        <p class="text-center">未找到相关结果。</p>
    {% endif %}
{% endblock %}